home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 30
/
Aminet 30 (1999)(Schatztruhe)[!][Apr 1999].iso
/
Aminet
/
util
/
boot
/
ConsoleFix.readme
< prev
next >
Wrap
Text File
|
1999-03-02
|
3KB
|
94 lines
Short: Fix a bug in the console.device
Author: thor@math.tu-berlin.de (Thomas Richter)
Uploader: thor@math.tu-berlin.de (Thomas Richter)
Version: 1.00
Type: util/boot
Requires: Os 3.0 (V39) or better
Purpose of this program:
This little patch fixes possible crashes of the console.device task, which,
luckely, do not show up under "normal" circumstances. However, as soon as
the console.device supervisor task takes more stack than usual, or this
stack is filled by more than just zeros, the console device will crash on
window resizes.
The reason for this crash is that the console.device main task uses a
faulty algorithm to traverse an exec style list: The list header is
also processed as a "node". Due to some lucky coincidences, the only data
that gets querried by this faulty node is on the stack of the console device,
and again due to some coincidence, this points to an area of the stack which
is usually set to zero. All provided the stack of the console.device doesn't
grow too much.
For the experts:
The main loop of the console device looks like this:
lea WindowList(a6),a2 ;get the head of the window list
.loop:
bsr ProcessWindow ;re-calcutes the window on a resize
move.l (a2),a2 ;get next node
tst.l (a2) ;end of list?
bne.s .loop
Hence, the list header is processed as a first node. Urgh!
The correct method would have been:
lea WindowList(a6),a2 ;get the head of the window list
bra.s .into
.loop:
bsr ProcessWindow ;re-calcutes the window on a resize
.into:
move.l (a2),a2 ;get next node
tst.l (a2) ;end of list?
bne.s .loop
This program fixes this bug by "hacking in" a new main loop for the console
device, the source code is included.
I'm sorry for the uglyness of this patch, it was designed at 2 a.m. in the
night and I was all than awake. It currently works like it is, but I'd really
prefer if someone could write a "nicer" fix, or if AI would include this fix
in the "SetPatch" program.
_____________________________________________________________________________
Credits:
Thanks goes to Nils Goers and his StackSnoop program. This console.device
problem showed up while Nils was beta-testing his program, and I was
curious what could have caused the crash. Stack-Snoop fills the application
stack with a "magic cookie" to find out the true stack size a program re-
quires, and this magic cookie caused the buggy code above to get mad.
Always interested in the true reason for a crash, I found the above bug...
_____________________________________________________________________________
Copyright:
None, this is freeware, public domain. Do whatever you want to do
with it.
_____________________________________________________________________________
Thomas,
January 1999
============================= Archive contents =============================
Original Packed Ratio Date Time Name
-------- ------- ----- --------- -------- -------------
596 471 20.9% 07-Jan-99 14:42:04 +ConsoleFix
6118 1570 74.3% 07-Jan-99 15:01:20 +ConsoleFix.asm
2767 1209 56.3% 07-Jan-99 14:59:22 +ConsoleFix.readme
-------- ------- ----- --------- --------
9481 3250 65.7% 11-Jan-99 13:00:56 3 files